package com.ct.ecommerce.framework.enums;

/**
 * @author changtong
 * @date 2021-50-20
 */
public enum OrderStatusEnum {
    /**
     * 0待支付 1待发货 2已发货 3已签收 4.已取消
     */
    ToBePaid(0, "待支付"),
    ToBeDelivery(1, "待发货"),
    Delivery(2, "已发货"),
    SignIn(3, "已签收"),
    Cancel(4,"已取消")
    ;

    private final int value;

    private final String showName;

    OrderStatusEnum(int value, String showName) {
        this.value = value;
        this.showName = showName;
    }

    public static OrderStatusEnum valueOf(int value) {
        for (OrderStatusEnum s : OrderStatusEnum.values()) {
            if (s.value == value) {
                return s;
            }
        }
        throw new IllegalArgumentException(String.format("值%s不能转换成枚举", value));
    }


    public String getShowName() {
        return showName;
    }

    public int getValue() {
        return value;
    }
}
